status: failed duration: 0.051s Captured stdout call zpk(z=2π·[-0.1591549430918953], p=2π·[], k=0.1) captured errors: zpk = ((-1,), (), 0.1) @pytest.mark.parametrize('zpk', [ ((0,), (), 0.1), ((), (0,), 0.1), ((-1,), (), 0.1), ((), (-1,), 0.1), ((0, 0,), (10, 10), 0.1), ((10, 10), (0, 0), 0.1), ((-1, -1,), (10, 10), 0.1), ((10, 10), (-1, -1), 0.1), ((0, ), (10, 10), 0.1), ((10, 10), (0,), 0.1), ((-1, ), (10, 10), 0.1), ((10, 10), (-1, ), 0.1), ]) def test_ZPK_various(zpk): """ Test the conversions to and from ZPK representation and statespace representation using a delay filter """ delta_t = 1 axB = mplfigB(Nrows=2) F_Hz = logspaced(0.01 / delta_t, 2 / delta_t, 1000) filt = SISO.zpk(zpk, fiducial_rtol=1e-7) print(filt) xfer1 = filt.fresponse(f=F_Hz).tf axB.ax0.semilogx(F_Hz, abs(xfer1), label="Direct ZPK") axB.ax1.plot(F_Hz, np.angle(xfer1, deg=True)) xfer2 = (filt * filt).fresponse(f=F_Hz).tf axB.ax0.semilogx(F_Hz, abs(xfer2), label="ZPK self product") axB.ax1.plot(F_Hz, np.angle(xfer2, deg=True)) > filt_ss = filt.asSS * 4 ../../src/wield/control/SISO/test/test_SISO_delay.py:194: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../src/wield/control/SISO/zpk.py:219: in asSS self._SS = algorithm_choice.algo_run( ../../src/wield/control/utilities/algorithm_choice.py:174: in algo_run ret = func(*args, **kwargs) ../../src/wield/control/SISO/algorithms_zpk2ss.py:81: in zpk2ss_chain_poly statesp = ss.SISOStateSpace( ../../src/wield/control/SISO/ss.py:130: in __init__ self.__init_internal__( ../../src/wield/control/utilities/__init__.py:35: in wrap ret = self.method(inst, *args, **kw) ../../src/wield/control/SISO/ss.py:163: in __init_internal__ self.test_fresponse( ../../src/wield/control/SISO/siso.py:45: in test_fresponse self_response = self.fresponse(**fiducial.domain_kw()) ../../src/wield/control/SISO/ss.py:287: in fresponse tf = self.ss.fresponse_raw(f=f, w=w, s=s, z=z, **kwargs)[..., 0, 0] ../../src/wield/control/ss_bare/ss.py:288: in fresponse_raw return algorithm_choice.algo_run( ../../src/wield/control/utilities/algorithm_choice.py:174: in algo_run ret = func(*args, **kwargs) ../../src/wield/control/ss_bare/algorithms_xfers.py:21: in ss2fresponse_laub ss = ss.balanceA(which='ABC') ../../src/wield/control/ss_bare/ss.py:574: in balanceA Ascale, (sca, P) = scipy.linalg.matrix_balance( /opt/conda/lib/python3.12/site-packages/scipy/linalg/_basic.py:1662: in matrix_balance A = np.atleast_2d(_asarray_validated(A, check_finite=True)) /opt/conda/lib/python3.12/site-packages/scipy/_lib/_util.py:321: in _asarray_validated a = toarray(a) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ a = array([[0. , 1. ], [0.5, nan]]), dtype = None, order = None @set_module('numpy') def asarray_chkfinite(a, dtype=None, order=None): """Convert the input to an array, checking for NaNs or Infs. Parameters ---------- a : array_like Input data, in any form that can be converted to an array. This includes lists, lists of tuples, tuples, tuples of tuples, tuples of lists and ndarrays. Success requires no NaNs or Infs. dtype : data-type, optional By default, the data-type is inferred from the input data. order : {'C', 'F', 'A', 'K'}, optional Memory layout. 'A' and 'K' depend on the order of input array a. 'C' row-major (C-style), 'F' column-major (Fortran-style) memory representation. 'A' (any) means 'F' if `a` is Fortran contiguous, 'C' otherwise 'K' (keep) preserve input order Defaults to 'C'. Returns ------- out : ndarray Array interpretation of `a`. No copy is performed if the input is already an ndarray. If `a` is a subclass of ndarray, a base class ndarray is returned. Raises ------ ValueError Raises ValueError if `a` contains NaN (Not a Number) or Inf (Infinity). See Also -------- asarray : Create and array. asanyarray : Similar function which passes through subclasses. ascontiguousarray : Convert input to a contiguous array. asfarray : Convert input to a floating point ndarray. asfortranarray : Convert input to an ndarray with column-major memory order. fromiter : Create an array from an iterator. fromfunction : Construct an array by executing a function on grid positions. Examples -------- Convert a list into an array. If all elements are finite ``asarray_chkfinite`` is identical to ``asarray``. >>> a = [1, 2] >>> np.asarray_chkfinite(a, dtype=float) array([1., 2.]) Raises ValueError if array_like contains Nans or Infs. >>> a = [1, 2, np.inf] >>> try: ... np.asarray_chkfinite(a) ... except ValueError: ... print('ValueError') ... ValueError """ a = asarray(a, dtype=dtype, order=order) if a.dtype.char in typecodes['AllFloat'] and not np.isfinite(a).all(): > raise ValueError( "array must not contain infs or NaNs") E ValueError: array must not contain infs or NaNs /opt/conda/lib/python3.12/site-packages/numpy/lib/function_base.py:630: ValueError